
//
//  HomePicCell.swift
//  BQWB
//
//  Created by laibingqiang on 16/10/28.
//  Copyright © 2016年 laibingqiang. All rights reserved.
//

import UIKit

class HomePicCell: UICollectionViewCell {
    
    var pic_url:HomePicModel?{
        
        didSet{
            imgV.bq_setImage(withURLString: pic_url?.thumbnail_pic, placeholderImage: "")
        }
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI(){
        
       // contentView.backgroundColor = UIColor.blue
        contentView.addSubview(imgV)
        
        imgV.snp_makeConstraints { (make) in
            
            //make.edges.equalTo(EdgeInsets(top: 5, left: 5, bottom: 5, right: 10))
            make.edges.equalTo(contentView)
        }
        
    }
    
    //懒加载控件
    private lazy var imgV:UIImageView = {
        
        let view = UIImageView(imgName: "")
        //view.backgroundColor = UIColor.blue
        
        view.contentMode = UIViewContentMode.scaleAspectFill
        view.layer.masksToBounds = true
        
        return view
    }()
}
